﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Forums.SyncService
{
    /// <summary>
    /// Contains the results of a Thread Synchronization
    /// </summary>
    public class SynchronizeThreadSummary : ISynchronizeSummary
    {
        /// <summary>
        /// Id of the thread which was synchronized
        /// </summary>
        public Guid ThreadId
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the forum id.
        /// </summary>
        /// <value>The forum id.</value>
        public Guid ForumId
        {
            get;
            private set;
        }

        /// <summary>
        /// List of posts which were either updated or added
        /// </summary>
        public IList<SynchronizePostSummary> PostSummaries
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets or sets the type of the synchronize.
        /// </summary>
        /// <value>The type of the synchronize.</value>
        public SynchronizeType SynchronizeType
        {
            get;
            private set;
        }

        /// <summary>
        /// Creates a summary object for the synchronization of a thread
        /// </summary>
        /// <param name="threadId">Id of Thread which was synchronized</param>
        /// <param name="postIds">Posts of the thread which were updated or added</param>
        public SynchronizeThreadSummary(Guid forumId, Guid threadId, IList<SynchronizePostSummary> postSummaries, SynchronizeType synchronizeType)
        {
            ForumId = forumId;
            PostSummaries = postSummaries;
            ThreadId = threadId;
            SynchronizeType = synchronizeType;
        }
    }
}
